#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import threading


class DeferDo(threading.Thread):
    def __init__(self, defer, cookie=None):
        threading.Thread.__init__(self)
        self.defer = defer
        self.cookie = cookie
        self.start()

    def run(self):
        self.defer(self.cookie)
